/**
 * 
 */
package org.vsg.stock.basic.algorithm;

/**
 * @author vison
 *
 */
public class AnalysisAlgorithm {
	

	public final static String BIG_RISE = "9";

	public final static String MID_RISE = "8";	
	
	public final static String SMALL_RISE = "7";	
	
	public final static String TINY_RISE = "6";		
	
	public final static String NO_RISEANDDESCEND = "5";

	public final static String TINY_DESCEND = "4";		
	
	public final static String SMALL_DESCEND = "3";	

	public final static String MID_DESCEND = "2";	
	
	public final static String BIG_DESCEND = "1";	

	
	public static final String changeAbstractValue(double value) {
		
		String result = "N";
		
		if (value >=0.066) {
			result = BIG_RISE;
		}
		else if (value < 0.066 && value >= 0.033) {
			result = MID_RISE;
		}
		else if (value >= 0.01 && value < 0.033) {
			result = SMALL_RISE;
		}
		else if (value > 0 && value < 0.01) {
			result = TINY_RISE;
		}
		else if (value < 0 && value > -0.01) {
			result = TINY_DESCEND;
		}
		else if (value <= -0.01 && value > -0.033) {
			result = SMALL_DESCEND;
		}
		else if (value <=-0.033 && value > -0.066) {
			result = MID_DESCEND;			
		}
		else if (value <-0.066) {
			result = BIG_DESCEND;			
		} 
		else {
			result = NO_RISEANDDESCEND;
		}
		
		
		return result;
	}

}
